package com.sas.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import com.sas.dao.ShangpinDao;
import com.sas.entity.Shangpin;
import com.sas.entity.Chukudan;
import com.sas.entity.Page;
import com.sas.service.ShangpinService;

@Service("shangpinService")
public class ShangpinServiceImpl implements ShangpinService{
    
	
	
	@Autowired
	ShangpinDao ShangpinDao;
	//�������ж���
	public List<Shangpin> selectShangpin() {
		return ShangpinDao.selectShangpin();
	}
   //ɾ�����
	public int deleteShangpin(Shangpin I) {
		// TODO Auto-generated method stub
		return ShangpinDao.deleteShangpin(I);
	}
    //���Ӷ���
	@Cacheable(value="myCache")
	public int insertShangpin(Shangpin I) {
		// TODO Auto-generated method stub
		return ShangpinDao.insertShangpin(I);
	}
	//�޸Ķ���
	@Cacheable( value = "myCache" )
	public int updateShangpin(Shangpin I) {
		// TODO Auto-generated method stub
		return ShangpinDao.updateShangpin(I);
	}

	
    //��ҳ
	public List<Shangpin> selectByShangpin(Shangpin I, Page page) {
		// TODO Auto-generated method stub
		return ShangpinDao.selectByShangpin(I, page);
	}
	//ͳ��������
	public int selectCount() {
		// TODO Auto-generated method stub
		return ShangpinDao.selectCount();
	}
	@Override
	public int insertList(List<Chukudan> in) {
		// TODO Auto-generated method stub
		return ShangpinDao.insertList(in);
	}
	@Override
	public int truncate() {
		// TODO Auto-generated method stub
		return ShangpinDao.truncate();
	}
	@Override
	public int insertList1(List<Chukudan> in) {
		// TODO Auto-generated method stub
		return ShangpinDao.insertList1(in);
	}
	@Override
	public List<Chukudan> selectChukudan() {
		// TODO Auto-generated method stub
		return ShangpinDao.selectChukudan();
	}
	
	

	
	

}
